package notes.java.thread;

import java.util.LinkedList;
import java.util.List;

/**
 * 	测试OOM
 * JVM参数： -Xms5M -Xmx5M -XX:+PrintGCDetails
 */
public class JavaOOM {

	public static void main(String[] args) {
		
		List<Object> list = new LinkedList<Object>();
		int i = 0;
		while(true) {
			if(i / 10000 == 0) System.out.println(i);
			list.add(new Object());
			i++;
		}
	}
}
